package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.UserDto;
import com.zzyl.entity.User;
import com.zzyl.vo.UserVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    void insert(User user);

    /**
     * 角色修改+禁用+菜单编辑接口
     * @param user
     */
    void update(User user);

    @Select("select * from sys_user where id = #{id}")
    User selectByid(Long id);

    void updateByStatus(User user);

    @Select("select * from sys_user")
    List<UserVo> selectList(User user);

    Page<List<User>> selectPage(UserDto userDto);

    @Delete("delete from sys_user where id = #{userId}")
    void deleteById(Long userId);

    void updatePassword(Long userId);

    @Select("select count(1) from sys_user where dept_no = #{deptId}")
    int checkDeptExistUser(String deptId);
}














